package com.ju.demo.controller;

import com.ju.demo.entity.Monitor;
import com.ju.demo.service.MonitorService;
import com.ju.demo.util.LogUtil;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;


@Api("controller-交换班班长业务控制器")
@Slf4j
@Controller
@RequestMapping("exchangeTeam")
public class MonitorController {

    @Autowired
    private MonitorService monitorService;

    @GetMapping("/monitor/{id}")
    public String selectMonitorById(@PathVariable("id")Integer id){
        LogUtil.write(id.toString());
        String monitor = monitorService.findMonitorByTeamID(id).toString();
        LogUtil.write(monitor);
        return monitor;
    }
}
